From: Matthew Daley Date: Wed, 30 Oct 2013 07:51:53 +0000 (+1300) Subject: libxl: don't leak memory in libxl__poller_get failure case X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6100 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=1edd6d8da354442b860ae28b8944dbd8a102d5f7;p=xen.git libxl: don't leak memory in libxl__poller_get failure case Coverity-ID: 1055894 Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index c5e942616b..0fe44288f4 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -1339,7 +1339,10 @@ libxl__poller *libxl__poller_get(libxl_ctx *ctx) memset(p, 0, sizeof(*p)); rc = libxl__poller_init(ctx, p); - if (rc) return NULL; + if (rc) { + free(p); + return NULL; + } return p; }